package main
// import "fmt"
// import "unsafe"
import(
	"fmt"
)

func main(){
     //定义一个整数类型
	 var num1 int8 = 6
	 fmt.Println(num1)
	 var num2 int = (10 + 20) % 3 + 3 - 7 //右侧计算值赋值给左侧
	 fmt.Println(num2)
	 
	 var num3 int = 10
	 num3 += 20 //num3 = num3 + 20
	 fmt.Println(num3)

	 //练习：交换两个数的值并输出结果
	 var a int = 8
	 var b int = 5
	 fmt.Printf("a = %v,b = %v",a,b)
	 fmt.Println()
	 //交换，引入中间变量
	 var t int
	 t = a
	 a = b
	 b = t
	 fmt.Printf("a = %v,b = %v",a,b)

}